{layout name="public/layout" /}
<div class="main" style="min-height: 600px;">
    {if $op=='module_users'}
    <div style="width: 100%;text-align: right;padding-bottom: 30px;">
        <div class="btn-group">
            <a class="btn btn-primary" style="width: 100px; "
               href="{php echo createWebUrl('users', array('module'=>$module,'op'=>'module_users_add'))}">新增</a>
        </div>
    </div>
    <div class="panel panel-default">
        <div class="panel-body table-responsive">
            <table class="table table-hover">
                <thead class="navbar-inner">
                <tr>
                    <th style="width:50px;">ID</th>
                    <th>用户名</th>
                    <th>结束时间</th>
                    <th style="width:160px; text-align:right;">操作</th>
                </tr>
                </thead>
                <tbody>
                {loop $list $i $item}
                <tr>
                    <td>{$item['id']}</td>
                    <td>{$item['username']}</td>
                    <td>{$item['endtime']}</td>
                    <td style="text-align: right">
                        <div class="btn-group">
                            <a class="btn btn-primary btn-sm"
                               href="{php echo createWebUrl('users', array('id' =>$item['id'],'op'=>'module_users_edit'))}"
                               title="编辑"><i class="icon-edit"></i>编辑</a>
                            <a class="btn btn-danger btn-sm"
                               href="{php echo createWebUrl('users', array('id' =>$item['id'],'op'=>'delete'))}"
                               title="删除"><i class="icon-edit"></i>删除</a>
                        </div>
                    </td>
                </tr>
                {/loop}
                </tbody>
            </table>
        </div>
        {$pager}
    </div>
    {elseif $op=='module_users_add' }
    <div class="panel panel-default" role="tabpanel">
        <div class="panel-body">
            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">注册信息</label>
                <div class="col-sm-10 col-lg-9 col-xs-12">
                    <textarea id="" name="" style="height:300px;" class="form-control">{$reginfo}</textarea>
                    <span class="help-block">  <a href="javascript:;" class="btn btn-default js-clip" data-url="{$reginfo}">一键复制</a></span>
                </div>
            </div>
        </div>
    </div>
    {elseif $op=='module_users_edit'}
    <div class="panel panel-default" role="tabpanel">
        <div class="panel-body">
            <form action="{php echo createWebUrl('users',array('op' => 'module_users_save'))}" method="post"
                  enctype="form-data" class="form-horizontal" role="form" style="padding:10px;">
                <input type="hidden" name="id" value="{$info['id']}"/>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">用户名</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" placeholder="" name="username"
                               value="{$info['username']}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">
                        <span style='color:red'>*</span>密码</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" placeholder="" name="password" value="">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 col-lg-2 control-label">
                        <span style='color:red'>*</span>确认密码</label>
                    <div class="col-sm-8 col-xs-12">
                        <input type="text" class="form-control" placeholder="" name="repassword" value="">
                    </div>
                </div>

                <div class="modal-footer">
                    <button type="submit" class="btn btn-primary">确定</button>
                </div>
            </form>
        </div>
    </div>
    {/if}
</div>
<script type="text/javascript">
    function jump() {
        layer.msg('正在准备下载');
    }

    function submitForm() {
        var form = document.getElementById("myform");
        form.submit();
    }
</script>
